function[] = trainPerceptronWithFiles()

    data = load('../dataperceptron/perceptrondata.dat')';
    targets = load('../dataperceptron/perceptrontarget1.dat');
    weights = perco(data, targets, 100);
    
    figure;
    subplot(2,1,1);
    gscatter(data(1,:), data(2,:), targets);
    hold on;
    func = [num2str(weights(2)) ' * x + ' num2str(weights(3)) ' * y - ' num2str(-weights(1))];
    ezplot(func);
    
    suffix = '';
    if (~weights(4))
        suffix = ' - did not converge';
    end
    title(['perceptrontarget1.dat' suffix]);
    
    targets = load('../dataperceptron/perceptrontarget2.dat');
    weights = perco(data, targets, 100);
    
    subplot(2,1,2);
    gscatter(data(1,:), data(2,:), targets);
    hold on;
    func = [num2str(weights(2)) ' * x + ' num2str(weights(3)) ' * y - ' num2str(-weights(1))];
    ezplot(func);
    
    suffix = '';
    if (~weights(4))
        suffix = ' - did not converge';
    end
    title(['perceptrontarget2.dat' suffix]);
end
